`{php $bootstrap_type = 3;}
{template 'header'}
<link type="text/css" rel="stylesheet" href="./source/modules/shopping/images/style.css">
<div class="head">
	<a href="javascript:history.back();" class="bn pull-left"><i class="icon-angle-left"></i></a>
	<span class="title">订单详情</span>
	<a href="{php echo $this->createMobileUrl('mycart')}" class="bn pull-right"><i class="icon-shopping-cart"></i></a>
</div>
 
<div class="myoder img-rounded" style='padding-bottom: 10px;'>
	<div class="myoder-hd">
		<span class="pull-left">订单编号：{$item['ordersn']}</span>
		<span class="pull-right">{php echo date('Y-m-d H:i', $item['createtime'])}</span>
	</div>
    
	{loop $goods $g}
	<div class="myoder-detail">
		<a href="{php echo $this->createMobileUrl('detail', array('id' => $g['id']))}"><img src="{$_W['attachurl']}{$g['thumb']}" width="160"></a>
		<div class="pull-left">
			<div class="name"><a href="{php echo $this->createMobileUrl('detail', array('id' => $g['id']))}">{$g['title']}</a></div>
			<div class="price">
				<span>{$g['marketprice']} 元{if $g['unit']} / {$g['unit']}{/if}</span>
				<span class="num">{$g['total']}{if $g['unit']} {$g['unit']}{/if}</span>
			</div>
		</div>
	</div>
	{/loop}
	<div class="myoder-express">
		<span class="express-company">状态</span>
		<span class="express-num">
		{if $item['paytype'] == 3}
			{if $item['status'] == -1}
			<span class="text-muted">订单取消</span>
			{elseif $item['status'] < 3}
			<span class="text-danger">货到付款 / 未付款</span>
			{else}
			<span class="text-success">已完成</span>
			{/if}
		{else}
			{if $item['status'] == -1}
			<span class="text-muted">订单取消</span>
			{elseif $item['status'] == 0}
			<span class="text-danger">未付款</span>
			{elseif $item['status'] == 1}
			<span class="text-warning">已付款</span>
			{elseif $item['status'] == 2}
			<span class="text-warning">已发货</span>
			{else}
			<span class="text-success">已完成</span>
			{/if}
		{/if}
		</span>
	</div>
	<div class="myoder-express">
		<span class="express-company">配送方式</span>
		<span class="express-num">{$dispatch['dispatchname']}</span>
	</div>
	{if ($item['status'] == '2' || $item['status']==3) && !empty($item['expresssn'])}
	<div class="myoder-express">
            <span class="express-company">快递: {$item['expresscom']}</span>
		<span class="express-num">
                    单号: {$item['expresssn']}
                    
		 </span>
	</div>
        <div class="myoder-total" style='margin-bottom:10px;'>
		<a href="http://m.kuaidi100.com/index_all.html?type={$item['express']}&postid={$item['expresssn']}#input" class="btn btn-success pull-right btn-sm" >查看快递</a>
	</div>
        
	{/if}
    {if !empty($item['remark'])}
             <div class="myoder-express" style='margin-top:10px;'>
		<span class="express-company">订单备注</span>
		
	</div>
  
        <div style='float:left;margin:10px;overflow:hidden;word-break:break-all;width:100%;'>
            {$item['remark']}
        </div> 
        {/if}
	<div class="myoder-total" style='margin-bottom:30px;'>
		<span>共计：<span class="false">
                     {if $item['dispatchprice']<=0}
                        {$item['price']} 元
                        {else}
                        {$item['price']} 元 (含运费 {$item['dispatchprice']} 元) 
                        {/if}
                    </span></span>
		{if $item['paytype'] != 3}
		{if $item['status'] == 0}
		<a href="{php echo $this->createMobileUrl('pay', array('orderid' => $item['id']))}" class="btn btn-danger pull-right btn-sm">立即支付</a>
		{/if}
		{/if}
		{if $item['status'] == 2 || ($item['paytype'] == 3 && $item['status'] < 3)}
		<a href="{php echo $this->createMobileUrl('myorder', array('orderid' => $item['id'], 'op' => 'confirm'))}" class="btn btn-success pull-right btn-sm" onclick="return confirm('点击确认收货前，请确认您的商品已经收到。确定收货吗？'); ">确认收货</a>
		{/if}
	</div>
</div>
 
{template 'footer'}
{template 'footerbar'}
<script>
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
	WeixinJSBridge.call('hideOptionMenu');
});
</script>